package com.wensen.service;

import com.wensen.mapper.BankInfoMapper;
import io.seata.core.context.RootContext;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class BankInfoSerivce {

    @Autowired
    private BankInfoMapper bankInfoMapper;

    @Transactional
    public void updateBankInfo(int id){
        // 获取 XID
        String xid = RootContext.getXID();
        System.out.println("productXID===="+xid);
        bankInfoMapper.updateBankInfoById(id);

        System.out.println("zhangsan2-100 success");
    }
}
